import { View } from "../../../mvc/core/View";
import { LayerManager } from "../../manager/LayerManager";
import { EffectManager } from "../../manager/EffectManager";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
//class RaceCopyIconBtn
    
    export  class RaceCopyIconBtn extends View
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.createChildren();
            this.addListeners();
            return;
        }

        public showEffect(arg1: Boolean): void
        {
            var loc1=null;
            var loc2=null;
            if (arg1) 
            {
                loc1 = new Object /* flash.filters.GlowFilter */(268435302, 1, 6, 6, 4);
                loc2 = [loc1];
                EffectManager.glowFilterReg(this._raceCopyBtn, loc2, 0.8, 10, 5, 0);
            }
            else 
            {
                EffectManager.glowFilterUnReg(this._raceCopyBtn);
            }
            return;
        }

        /* internal  */createChildren(): void
        {
            this._raceCopyBtn = ObjCreate.createGLoadedButton(ResFileConst.RaceCopyIconBtn, 0, 0, 60, 50, this);
            return;
        }

        /* internal  */addListeners(): void
        {
            this._raceCopyBtn.addEventListener(flash.events.MouseEvent.CLICK, this.openRaceCopyChoosePanel);
            return;
        }

        protected openRaceCopyChoosePanel(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.RaceCopyOpenChoosePanel));
            return;
        }

        /* internal */ /* var */_raceCopyBtn: GLoadedButton;
    }
